# -*- coding:utf-8 -*-

from flask import Flask
from flask_script import Manager
import os,gensim


def create_app():
    app = Flask(__name__)
    from v1 import app as api_v1
    app.register_blueprint(api_v1, url_prefix='/zzh/app/v0.1')

    from v2 import app as api_v2
    app.register_blueprint(api_v2, url_prefix='/zzh/app/v2')

    from v3 import app as api_v3
    app.register_blueprint(api_v3, url_prefix='/zzh/app/v3')

    return app


app = create_app()
manager = Manager(app)

curPath = os.path.dirname(__file__)
filePath = os.path.join(curPath, 'com', 'zzh', 'bigSearch', 'vectors.bin')
model = gensim.models.KeyedVectors.load_word2vec_format(filePath, binary=True)

if __name__ == '__main__':
    app = create_app()
    app.run(host='127.0.0.1', port=5005, debug=True)
    manager.run()
